// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_e;

import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Proxy;
import android.net.Uri;

// Referenced classes of package com.nnee.e:
//            c, d

public class cls_b
{

    private cls_b(Context context)
    {
        g = new cls_c(this);
        e = context;
        b = (ConnectivityManager)e.getSystemService("connectivity");
    }
 

    public static cls_b a(Context context)
    {
        
        cls_b b1;
        if(c == null)
            c = new cls_b(context);
        b1 = c;
        
        return b1;
        
    }
 
    public void a()
    {
        
        String as[] = new String[4];
        as[0] = "apn";
        as[1] = "name";
        as[2] = "port";
        as[3] = "proxy";
        b();
        d = e.getContentResolver().query(a, as, null, null, null);
        if(d != null)
            d.registerContentObserver(g);
        
        return;
       
    }
 

    public void b()
    {
        
        if(d != null)
        {
            d.unregisterContentObserver(g);
            d.close();
            d = null;
            f = null;
        }
        
        return;
       
    }

    
    public cls_d c()
    {
        cls_d d1 = null;
        
        NetworkInfo networkinfo = b.getActiveNetworkInfo();
        if(networkinfo == null) {} else {
        	int i = networkinfo.getType();
            if(i == 0) {
            	 {
                     if(f == null)
                         {
                    	 if(d == null)
                             a();
                         if(d == null || !d.moveToFirst()) {} else 
                         {
                        	 String s;
                             d1 = new cls_d(this);
                             d1.a = d.getString(d.getColumnIndex("apn"));
                             d1.b = d.getString(d.getColumnIndex("name"));
                             s = d.getString(d.getColumnIndex("port"));
                             d1.c = Integer.parseInt(s);
                             d1.d = d.getString(d.getColumnIndex("proxy"));
                             com.nnee.p_g.cls_b.e("ApnReference", (new StringBuilder()).append("apn:").append(d1.a).append("-name:").append(d1.b).append("-port:").append(d1.c).append("-proxy:").append(d1.d).toString());
                             f = d1;
                               
                         }
                         }
                     else
                     {
                     d1 = f;
                     }
                 }
            }
        }
        
        return d1;
 
    }

    public static final Uri a = Uri.parse("content://telephony/carriers/preferapn");
    private static cls_b c;
    ConnectivityManager b;
    private Cursor d;
    private Context e;
    private cls_d f;
    private cls_c g;

}
